bd022b2c5da1c990bd689be5eaaf5919277e5573,plugins/maven/src/main/java/org/jetbrains/idea/maven/indices/MavenIndex.java,MavenIndex,hasValue,#PersistentHashMap#String#,514

Before Change


  }

  private boolean hasValue(final PersistentHashMap<String, ?> map, final String value) {
    return doIndexTask(new IndexTask<Boolean>() {
      public Boolean doTask() throws Exception {
        return map.tryEnumerate(value) != 0;
      }
    }, false).booleanValue();
  }

  public synchronized Set<MavenArtifactInfo> search(final Query query, final int maxResult) {

After Change


  private boolean hasValue(final PersistentHashMap<String, ?> map, Map<String, Boolean> cache, final String value) {
    Boolean res = cache.get(value);
    if (res == null) {
      res = doIndexTask(new IndexTask<Boolean>() {
        public Boolean doTask() throws Exception {
          return map.tryEnumerate(value) != 0;
        }
      }, false).booleanValue();

      cache.put(value, res);
    }

    return res;
  }

  public synchronized Set<MavenArtifactInfo> search(final Query query, final int maxResult) {